package com.tk.exam.service;

import com.tk.exam.domain.TkOperator;
import com.tk.exam.domain.TkOperatorExample;
import com.tk.exam.mapper.TkOperatorMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class TkOperatorServer {

    @Autowired
    TkOperatorMapper tkOperatorMapper;

    public TkOperator getByLoginName(String phone) {
        TkOperatorExample example = new TkOperatorExample();
        example.or().andOpePhoneEqualTo(phone);
        List<TkOperator> list = tkOperatorMapper.selectByExample(example);
        return list.isEmpty() ? null : list.get(0);
    }

}
